<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CtrlV</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="//cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<?php
	$contetnt = '';
	if (isset($_POST['code']) ){
		
		$db_code = base64_encode($_POST['code']);
		
		require('connect.php');
			if($db=connect()){
				try{
					$sql = 'SELECT `Y29udGVudA` FROM `clipboard` WHERE `Y3RybA`="'.$db_code.'";' ;
					
					$e = $db->prepare($sql);
					$e->execute();
					$ret =$e->fetch(PDO::FETCH_OBJ);
					
					$contetnt=base64_decode($ret->Y29udGVudA);
						
				}catch(Exception $e){
					
					?> <script>alert("EXM... I don't know what happend!")</script><?php
				}
				
				
				
			}else{
				?> <script>alert("EXM I don't know what happend!")</script><?php
			}

	}

	?>

	
	
	
	
	<div class="container" style="margin-top:9%;">
  		<div class="jumbotron">
        <div class="panel panel-success">
        <div class="panel-heading"><h1><legend align="center">Type Ur Code we have giveen to U </legend></h1>
			<form method="post" >
				<div class="input-group">
  <input name="code" type="textarea" class="form-control" placeholder="type in your content Code" aria-describedby="basic-addon2" value="<?php if (isset($_POST['code']) )echo $_POST['code'] ?>" required="" onKeyup="toUpperCase(this)">
 <span class="input-group-addon" id="basic-addon2"><button>CtrlV</button></span>
</div>	
			</form><br/>
			<textarea style="width: -webkit-fill-available; min-height: 10rem;" disabled><?php if(isset($contetnt)) echo $contetnt ?></textarea>
 
				
			<br/></div>
		</div>
			
       
          <p><h3>Your Mobile clipboard</h3></p>
          <p><li>CtrlC webSite only provide text content in the beta0 </li></p>
          <p><li>The textCode might be other's if you are not luuck </li></p>
          <p><li>Let's us wait for next version</li></p>
          <p><li>We are prepare to provide free service for everyOne</li></p>
          <p><li>You are more handsome/beatiful if you donate us</li></p>
        </div> </div>
	
</body>
<script>

 function toUpperCase(obj)
 {
 obj.value = obj.value.toUpperCase()
 }
</script>
</html>